package com.dobest.studentmanagement.service;

import com.dobest.studentmanagement.dao.StuRepository;
import com.dobest.studentmanagement.domain.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Package: com.dobest.studentmanagement.service
 * @author: Jounghu
 * @date: 2018/8/19 16:39
 * @version: V1.0
 */
@Service
public class StudentService {

    @Autowired
    StuRepository stuRepository;

    public Student saveOrUpdate(Student student) {
        return stuRepository.saveAndFlush(student);
    }

    public Student findOneByStuNum(String stuNum) {
        Student stu = stuRepository.findByStuNum(stuNum);
        return stu;
    }


}
